import React from 'react';
import ReactDOM from 'react-dom';
import store from './store';
import {Provider} from 'react-redux';
import zhCN from 'antd/lib/locale-provider/zh_CN';
import {LocaleProvider} from 'antd';
import routers from './routers';
import {Route, HashRouter, Redirect, Switch} from 'react-router-dom';
import './config';
import './assets';

ReactDOM.render(
    <Provider store={store} >
        <LocaleProvider locale={zhCN}>
            <HashRouter>
                <Switch>
                    {routers.map(v=>{
                        return <Route {...v} key={v.path} replace />
                    })}
                    <Redirect from="*" to="/" />
                </Switch>
            </HashRouter>
        </LocaleProvider>
    </Provider>
    , 
    document.getElementById('app')
)